package edu.ynu.se.xiecheng.achitectureclass.project.po.entity;

import com.fasterxml.jackson.annotation.JsonBackReference;
import edu.ynu.se.xiecheng.achitectureclass.common.entity.LogicEntity;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.util.Date;

@Entity
@Getter
@Setter
@Table(name = "AirTemperatureData")
//空气温度检测数据实体类
public class AirTemperatureData extends LogicEntity {

    @JsonBackReference
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "device_id", nullable = false)
    private Device device;

    @Column(name = "name")
    private String name;

    @Column(name = "value")
    private Double value;

    @Column(name = "unit")
    private String unit; // 单位，例如 ℃

    @Column(name = "timestamp")
    private Date timestamp;
}